package com.example.administrator.dc.Bean;

import com.google.gson.Gson;

import org.json.JSONException;
import org.json.JSONObject;

/**
 * Created by Administrator on 2017/8/22.
 */

public class UserPhoto {

    /**
     * cid : 30
     * uid : 46
     * title : 我好美啊
     * photo : http://118.89.227.169/Public/Uploads/cameraphotos/20170613210635902.jpg
     * createtime : 2017-06-13 21:06:35
     * aliasname : 我爱php
     * gender : 1
     * pic : http://118.89.227.169/Public/Uploads/photos/20170612203100683.jpg
     */

    private int cid;
    private int uid;
    private String title;
    private String photo;
    private String createtime;
    private String aliasname;
    private int gender;
    private String pic;

    public static UserPhoto objectFromData(String str, String key) {

        try {
            JSONObject jsonObject = new JSONObject(str);

            return new Gson().fromJson(jsonObject.getString(str), UserPhoto.class);
        } catch (JSONException e) {
            e.printStackTrace();
        }

        return null;
    }

    public void setCid(int cid) {
        this.cid = cid;
    }

    public void setUid(int uid) {
        this.uid = uid;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public void setPhoto(String photo) {
        this.photo = photo;
    }

    public void setCreatetime(String createtime) {
        this.createtime = createtime;
    }

    public void setAliasname(String aliasname) {
        this.aliasname = aliasname;
    }

    public void setGender(int gender) {
        this.gender = gender;
    }

    public void setPic(String pic) {
        this.pic = pic;
    }

    public int getCid() {
        return cid;
    }

    public int getUid() {
        return uid;
    }

    public String getTitle() {
        return title;
    }

    public String getPhoto() {
        return photo;
    }

    public String getCreatetime() {
        return createtime;
    }

    public String getAliasname() {
        return aliasname;
    }

    public int getGender() {
        return gender;
    }

    public String getPic() {
        return pic;
    }
}
